import { Button, Result } from 'antd';

import { memo } from 'react';
import { useHistory } from 'react-router-dom';

const NotFound = memo(() => {
  const history = useHistory();
  const goHome = () => {
    history.replace('/');
  };
  return (
    <Result
      status="404"
      title="404"
      subTitle="你迷失在了知识的海洋"
      extra={
        <Button type="primary" onClick={goHome}>
          返回首页
        </Button>
      }
    />
  );
});

export default NotFound;
